<template>
  <div>
    <div class="top_right_top">
      <div class="top top_right" v-for="(item, index) in titleTypeList" :key="index">
        <div class="notice-or-note" @click="getSkip(item.path)">
          <div class="notice-top">
            <img v-if="item.iconType == 1" :src="item.img" class="img" />
            <svg-icon v-else-if="item.iconType == 2" :icon-class="item.img" class="img"></svg-icon>
            {{ item.title }}
          </div>
          <div class="notice-bottom">
            <el-tooltip effect="dark" :content="item.subTitle" placement="bottom-start">
              <div class="text">{{ item.subTitle }}</div>
            </el-tooltip>
            <i class="el-icon-arrow-right"></i>
          </div>
        </div>
      </div>
      <!-- <div class="top top_right">
        <div class="document_box">
          <div class="document_box_item" @click="getSkip('/newUi/networkDisk/doc')">
            <div class="svg_size bg1">
              <svg-icon icon-class="yinpan"></svg-icon>
            </div>
            <div class="document_box_item_content">个人文档</div>
          </div>
          <div class="document_box_item" @click="getSkip('/newUi/teams/team')">
            <div class="svg_size bg2">
              <svg-icon icon-class="team"></svg-icon>
            </div>
            <div class="document_box_item_content">团队空间</div>
          </div>
          <div class="document_box_item" @click="getSkip('/newUi/enterprises/company')">
            <div class="svg_size bg3">
              <svg-icon icon-class="enterprise"></svg-icon>
            </div>
            <div class="document_box_item_content">企业文库</div>
          </div>
        </div>
      </div> -->
    </div>
  </div>
</template>

<script setup lang="ts">
import noticeImg from "@/assets/images/home/notice.png";
import noteImg from "@/assets/images/home/note.png";
const {proxy} = getCurrentInstance() as any;
const router = useRouter();
const titleTypeList = ref([
  { title:"知识公告", subTitle: "发布知识公告,让企业所有员工关注" , iconType: 2, img: 'inform', path: "/notice/notice/noticeList" },
  { title:"AI问答", subTitle:"有问必答,将会是你的智能助手", iconType: 2, img: "ai", path: "/aiQA/chatGptIndex" },
  { title: "企业知识库", subTitle: proxy.$t("home.titleSub4"), iconType: 2, img: "ecmdocument", path: "/newUi/enterprises/enterpriseList" },
  { title: "个人知识库", subTitle: proxy.$t("home.titleSub4"), iconType: 2, img: "knowledge", path: "/newUi/networkDisk/doc" }
])
// 跳转页面
const getSkip = (path: any) => {
  router.push(path);
}
</script>


<style lang="scss" scoped>
.notice-or-note {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  height: 100%;
  cursor: pointer;

  .notice-top {
    height: 30px;
    font-size: 17px;
    font-weight: bolder;
    line-height: 30px;
    display: flex;
    min-width: 135px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    .img {
      width: 25px;
      height: 25px;
      margin-right: 10px;
    }
  }

  .notice-bottom {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 13px;
    color: #ccc;
    height: 20px;
    line-height: 20px;
    cursor: pointer;

    .text {
      min-width: 90px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      margin-left: 30px;
    }
  }
}

.top_right_top {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  // justify-content: space-between;
  height: 75px;

  // line-height: 64px;
  .top {
    padding: 13px;
    min-width: 165px;
    width: 100%;
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid #eee;
    box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.1);
    height: 100%;
  }

  .top_right {
    margin-right: 10px;
  }
}

.document_box {
  display: flex;
  justify-content: space-around;
  align-content: center;

  .document_box_item {
    text-align: center;
    cursor: pointer;

    &:hover {
      color: #0a6cff;
    }

    .svg_size {
      font-size: 20px;
      width: 30px;
      height: 30px;
      display: flex;
      justify-content: center;
      align-items: center;
      border-radius: 5px;
      box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.16);
      margin: 0 auto;
    }

    .document_box_item_content {
      margin-top: 5px;
      font-size: 14px;
    }

    .bg1 {
      color: #ffffff;
      background-color: #ff8622;


    }

    .bg2 {
      color: #ffffff;
      background-color: #6aa7fe;

    }

    .bg3 {
      color: #ffffff;
      background-color: #0a6cff;

    }
  }
}
</style>
